<template>
  <div class="app-container">
    <vxe-split class="content" border vertical>
      <vxe-split-pane height="50%">
        <vxe-grid
          ref="gridRef"
          v-bind="gridOptions"
          @toolbar-button-click="toolbarButtonClickEvent"
          @form-submit="formSubmitEvent"
          @form-reset="formResetEvent"
          @current-row-change="currentRowChangeEvent"
        >
          <template #active="{ row }">
            <vxe-button
              mode="text"
              status="primary"
              content="编辑"
              icon="vxe-icon-edit"
              @click="updateRow(row)"
            ></vxe-button>
            <vxe-button
              mode="text"
              status="primary"
              content="删除"
              icon="vxe-icon-edit"
              @click="deleteData(row)"
            ></vxe-button>
            <vxe-button
              mode="text"
              status="primary"
              content="绑定设备"
              icon="vxe-icon-edit"
              @click="bindEquipment(row)"
            ></vxe-button>
            <vxe-button
              mode="text"
              status="primary"
              content="选择班组"
              icon="vxe-icon-edit"
              @click="bindTeam(row)"
            ></vxe-button>
          </template>
        </vxe-grid>
      </vxe-split-pane>
      <vxe-split-pane height="45%">
        <vxe-tabs v-model="activeTab" destroyOnClose="false">
          <vxe-tab-pane title="设备" name="1">
            <vxe-grid ref="gridRef3" v-bind="gridOptions3">
              <template #active="{ row }">
                <vxe-button
                  mode="text"
                  status="primary"
                  content="编辑"
                  icon="vxe-icon-edit"
                  @click.stop="updateRow(row)"
                ></vxe-button>
                <vxe-button
                  mode="text"
                  status="primary"
                  content="删除"
                  icon="vxe-icon-edit"
                  @click="deleteData(row)"
                ></vxe-button>
                <vxe-button
                  mode="text"
                  status="primary"
                  content="修改状态"
                  icon="vxe-icon-edit"
                  @click="updateWoRawStatus(row)"
                ></vxe-button>
              </template>
            </vxe-grid>
          </vxe-tab-pane>
          <vxe-tab-pane title="班组" name="2">
            <vxe-grid ref="gridRef4" v-bind="gridOptions4">
              <template #active="{ row }">
                <vxe-button
                  mode="text"
                  status="primary"
                  content="编辑"
                  icon="vxe-icon-edit"
                  @click.stop="updateRow(row)"
                ></vxe-button>
                <vxe-button
                  mode="text"
                  status="primary"
                  content="删除"
                  icon="vxe-icon-edit"
                  @click="deleteData(row)"
                ></vxe-button>
                <vxe-button
                  mode="text"
                  status="primary"
                  content="修改状态"
                  icon="vxe-icon-edit"
                  @click="updateWoRawStatus(row)"
                ></vxe-button>
              </template> </vxe-grid
          ></vxe-tab-pane>
        </vxe-tabs>
      </vxe-split-pane>
    </vxe-split>

    <!--新增基础数据-->
    <vxe-modal v-model="showPopup" v-bind="modalOptions" :loading="loading">
      <template #default>
        <vxe-form
          v-bind="formOptions"
          @submit="submitEvent"
          @reset="resetEvent"
        ></vxe-form>
      </template>
    </vxe-modal>
    <!--新增设备-->
    <vxe-modal
      v-model="showPopup2"
      v-bind="modalOptions2"
      show-footer
      :loading="loading"
      show-confirm-button
      @confirm="confirmEvent"
    >
      <template #default>
        <vxe-grid
          ref="gridRef2"
          :confirm-closable="false"
          v-bind="gridOptions2"
          @toolbar-button-click="toolbarButtonClickEvent"
          @form-submit="formSubmitEvent"
          @form-reset="formResetEvent"
        >
        </vxe-grid>
      </template>
    </vxe-modal>
    <!---选择班组-->
    <vxe-modal v-model="showPopup3" v-bind="modalOptions3" :loading="loading">
      <template #default>
        <vxe-form
          v-bind="formOptions3"
          @submit="submitEvent3"
          @reset="resetEvent"
        ></vxe-form>
      </template>
    </vxe-modal>
  </div>
</template>

<script>
import {
  getProceduresByPage,
  addProcedures,
  delProcedures,
} from "@/api/baseData/procedures";
import {
  getEquipmentConfigByPage,
  addEquipmentConfig,
  delEquipmentConfig,
} from "@/api/baseData/equipmentConfig";
import {
  addProceduresEquipmentConfigs,
  getProceduresEquipmentConfigByPage,
} from "@/api/baseData/proceduresEquipmentConfig";

import {
  addProceduresTeams,
  addProceduresTeam,
  getProceduresTeamByPage,
} from "@/api/baseData/proceduresTeam";
import {
  getTeamByPage,
  addTeam,
  selectUserListByTeam,
  getUserByTeamId,
  addTeamUser,
} from "@/api/baseData/team";
import { VxeUI } from "vxe-pc-ui";

import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const findPageList = async (page) => {
  await getMaterialByPage(page);
  // return new Promise(resolve => {
  //   setTimeout(() => {
  //     resolve({
  //       result: list.slice((currentPage - 1) * pageSize, currentPage * pageSize),
  //       page: {
  //         total: list.length
  //       }
  //     })
  //   }, 100)
  // })
};
export default {
  data() {
    const gridOptions = {
      sortConfig: {
        remote: true,
      },
      rowConfig: {
        isCurrent: true,
        isHover: true,
      },
      loading: false,
      stripe: true,
      showOverflow: true,
      showFooter: true,
      height: "100%",
      columnConfig: {
        resizable: true,
        drag: true,
      },
      columnDragConfig: {
        trigger: "cell",
        showIcon: false,
        showGuidesStatus: true,
      },

      resizableConfig: {
        isDblclickAutoWidth: true,
      },
      pagerConfig: {
        total: 0,
        currentPage: 1,
        pageSize: 10,
      },
      toolbarConfig: {
        refresh: true,
        import: true,
        export: true,
        print: true,
        zoom: true,
        custom: true,
        buttons: [
          { name: "新增", code: "myAdd", status: "primary" },
          { name: "删除", code: "myDel", status: "error" },
          { name: "保存", code: "mySave", status: "success" },
        ],
      },
      formConfig: {
        data: {
          name: "",
          role: "",
          sex: "",
          num: "",
          address: "",
        },
        items: [
          {
            field: "name",
            title: "名称",
            span: 8,

            itemRender: { name: "VxeInput", props: { clearable: true } },
          },

          {
            field: "createTime",
            title: "时间",
            span: 8,

            itemRender: {
              name: "VxeDatePicker",
              props: {
                multiple: true,
              },
            },
          },

          {
            collapseNode: true,
            align: "right",
            span: 8,
            itemRender: {
              name: "VxeButtonGroup",
              options: [
                { type: "submit", content: "搜索", status: "primary" },
                { type: "reset", content: "重置" },
              ],
            },
          },
          {
            field: "createTime",
            title: "时间",
            span: 8,
            folding: true,
            itemRender: {
              name: "VxeDatePicker",
              props: {
                multiple: true,
              },
            },
          },
        ],
      },
      columns: [
        { field: "seq", type: "seq", width: 70 },
        { field: "code", title: "工序编码", sortable: true, width: 180 },
        {
          field: "name",
          title: "工序名称",
          sortable: true,
          width: 180,
        },
        // {
        //   field: "describe",
        //   title: "名称",
        //   sortable: true,
        //   width: 180,
        // },
        {
          field: "standTime",
          title: "标准工时(分)",
          sortable: true,
          width: 180,
        },
        {
          field: "prepareTime",
          title: "准备工时(分)",
          sortable: true,
          width: 180,
        },
        {
          field: "transferTime",
          title: "转移工时(分)",
          sortable: true,
          width: 180,
        },
        { field: "createTime", title: "创建时间", width: 180 },
        {
          field: "active",
          title: "操作",
          fixed: "right",
          width: 400,
          slots: { default: "active" },
        },
      ],
      scrollX: {
        gt: 0,
        enabled: true,
      },
      scrollY: {
        gt: 0,
        enabled: true,
      },
      proxyConfig: {
        // props: {
        //   result: 'result', // 配置响应结果列表字段
        //   total: 'page.total' // 配置响应结果总页数字段
        // },

        sort: true,
        form: true,
        ajax: {
          query: async ({ page, sorts, form }) => {
            console.log(page, sorts, form, "----");
            // 默认接收 Promise<{ result: [], page: { total: 100 } }>
            let result = await getProceduresByPage({
              ...page,
            });
            return {
              result: result.data.records,
              page: {
                total: result.data.total,
              },
            };
          },
        },
      },
    };
    const gridOptions2 = {
      sortConfig: {
        remote: true,
      },
      height: "100%",
      loading: false,
      stripe: true,
      showOverflow: true,
      showFooter: true,

      columnConfig: {
        resizable: true,
        drag: true,
      },
      columnDragConfig: {
        trigger: "cell",
        showIcon: false,
        showGuidesStatus: true,
      },
      rowConfig: {
        isHover: true,
      },
      resizableConfig: {
        isDblclickAutoWidth: true,
      },
      pagerConfig: {
        total: 0,
        currentPage: 1,
        pageSize: 10,
      },
      toolbarConfig: {
        refresh: true,
        import: true,
        export: true,
        print: true,
        zoom: true,
        custom: true,
        buttons: [
          { name: "新增", code: "myAdd", status: "primary" },
          { name: "删除", code: "myDel", status: "error" },
          { name: "保存", code: "mySave", status: "success" },
        ],
      },
      formConfig: {
        data: {
          name: "",
          role: "",
          sex: "",
          num: "",
          address: "",
        },
        items: [
          {
            field: "name",
            title: "名称",
            span: 8,

            itemRender: { name: "VxeInput", props: { clearable: true } },
          },

          {
            field: "createTime",
            title: "时间",
            span: 8,

            itemRender: {
              name: "VxeDatePicker",
              props: {
                multiple: true,
              },
            },
          },

          {
            collapseNode: true,
            align: "right",
            span: 8,
            itemRender: {
              name: "VxeButtonGroup",
              options: [
                { type: "submit", content: "搜索", status: "primary" },
                { type: "reset", content: "重置" },
              ],
            },
          },
          {
            field: "createTime",
            title: "时间",
            span: 8,
            folding: true,
            itemRender: {
              name: "VxeDatePicker",
              props: {
                multiple: true,
              },
            },
          },
        ],
      },
      columns: [
        { type: "checkbox", width: 60 },

        { field: "code", title: "编码", sortable: true, width: 180 },
        {
          field: "name",
          title: "名称",
          sortable: true,
          width: 180,
        },
        {
          field: "levelName",
          title: "资源等级",
          sortable: true,
          width: 180,
        },
        { field: "createBy", title: "创建人", width: 180 },
        { field: "createTime", title: "创建时间", width: 180 },
        // {
        //   field: "active",
        //   title: "操作",
        //   fixed: "right",
        //   width: 400,
        //   slots: { default: "active" },
        // },
      ],
      scrollX: {
        gt: 0,
        enabled: true,
      },
      scrollY: {
        gt: 0,
        enabled: true,
      },
      proxyConfig: {
        // props: {
        //   result: 'result', // 配置响应结果列表字段
        //   total: 'page.total' // 配置响应结果总页数字段
        // },

        sort: true,
        form: true,
        ajax: {
          query: async ({ page, sorts, form }) => {
            console.log(page, sorts, form, "----");
            // 默认接收 Promise<{ result: [], page: { total: 100 } }>
            let result = await getEquipmentConfigByPage({
              ...page,
            });
            return {
              result: result.data.records,
              page: {
                total: result.data.total,
              },
            };
          },
        },
      },
    };
    const gridOptions3 = {
      editConfig: {
        trigger: "click",
        mode: "cell",
      },
      sortConfig: {
        remote: true,
      },
      height: "100%",
      loading: false,
      stripe: true,
      showOverflow: true,
      showFooter: true,

      columnConfig: {
        resizable: true,
        drag: true,
      },
      columnDragConfig: {
        trigger: "cell",
        showIcon: false,
        showGuidesStatus: true,
      },
      rowConfig: {
        isHover: true,
      },
      resizableConfig: {
        isDblclickAutoWidth: true,
      },
      pagerConfig: {
        total: 0,
        currentPage: 1,
        pageSize: 10,
      },

      formConfig: {
        data: {
          name: "",
          role: "",
          sex: "",
          num: "",
          address: "",
        },
        items: [
          {
            field: "name",
            title: "名称",
            span: 8,

            itemRender: { name: "VxeInput", props: { clearable: true } },
          },

          {
            field: "createTime",
            title: "时间",
            span: 8,

            itemRender: {
              name: "VxeDatePicker",
              props: {
                multiple: true,
              },
            },
          },

          {
            collapseNode: true,
            align: "right",
            span: 8,
            itemRender: {
              name: "VxeButtonGroup",
              options: [
                { type: "submit", content: "搜索", status: "primary" },
                { type: "reset", content: "重置" },
              ],
            },
          },
        ],
      },
      columns: [
        { type: "checkbox", width: 60 },
        { field: "seq", type: "seq", width: 70 },
        {
          field: "proceduresName",
          title: "工序名称",
          sortable: true,
          width: 180,
        },
        {
          field: "equipmentConfigName",
          title: "设备名称",
          sortable: true,
          width: 180,
          // editRender: { name: "input" },
        },

        // {
        //   field: "startTime",
        //   title: "计划开工时间",
        //   sortable: true,
        //   width: 180,
        // },
        { field: "createTime", title: "创建时间", width: 180 },
        {
          field: "active",
          title: "操作",
          fixed: "right",
          width: 300,
          slots: { default: "active" },
        },
      ],
      scrollX: {
        gt: 0,
        enabled: true,
      },
      scrollY: {
        gt: 0,
        enabled: true,
      },
      proxyConfig: {
        // props: {
        //   result: 'result', // 配置响应结果列表字段
        //   total: 'page.total' // 配置响应结果总页数字段
        // },

        sort: true,
        form: true,
        ajax: {
          query: async ({ page, sorts, form }) => {
            console.log(page, sorts, form, "----");

            // 默认接收 Promise<{ result: [], page: { total: 100 } }>
            let result = await getProceduresEquipmentConfigByPage({
              ...page,
              proceduresId: this.processRowData.id,

              // subId: this.woRawSub.id ? this.woRawSub.id : null,
            });
            this.woRawSub = { id: null, wo: null };
            return {
              result: result.data.records,
              page: {
                total: result.data.total,
              },
            };
          },
        },
      },
    };
    const gridOptions4 = {
      editConfig: {
        trigger: "click",
        mode: "cell",
      },
      sortConfig: {
        remote: true,
      },
      height: "100%",
      loading: false,
      stripe: true,
      showOverflow: true,
      showFooter: true,

      columnConfig: {
        resizable: true,
        drag: true,
      },
      columnDragConfig: {
        trigger: "cell",
        showIcon: false,
        showGuidesStatus: true,
      },
      rowConfig: {
        isHover: true,
      },
      resizableConfig: {
        isDblclickAutoWidth: true,
      },
      pagerConfig: {
        total: 0,
        currentPage: 1,
        pageSize: 10,
      },

      formConfig: {
        data: {
          name: "",
          role: "",
          sex: "",
          num: "",
          address: "",
        },
        items: [
          {
            field: "name",
            title: "名称",
            span: 8,

            itemRender: { name: "VxeInput", props: { clearable: true } },
          },

          {
            field: "createTime",
            title: "时间",
            span: 8,

            itemRender: {
              name: "VxeDatePicker",
              props: {
                multiple: true,
              },
            },
          },

          {
            collapseNode: true,
            align: "right",
            span: 8,
            itemRender: {
              name: "VxeButtonGroup",
              options: [
                { type: "submit", content: "搜索", status: "primary" },
                { type: "reset", content: "重置" },
              ],
            },
          },
        ],
      },
      columns: [
        { type: "checkbox", width: 60 },
        { field: "seq", type: "seq", width: 70 },
        {
          field: "proceduresName",
          title: "工序名称",
          sortable: true,
          width: 180,
        },
        {
          field: "teamName",
          title: "班组名称",
          sortable: true,
          width: 180,
        },
        { field: "createTime", title: "创建时间", width: 180 },
        {
          field: "active",
          title: "操作",
          fixed: "right",
          width: 300,
          slots: { default: "active" },
        },
      ],
      scrollX: {
        gt: 0,
        enabled: true,
      },
      scrollY: {
        gt: 0,
        enabled: true,
      },
      proxyConfig: {
        // props: {
        //   result: 'result', // 配置响应结果列表字段
        //   total: 'page.total' // 配置响应结果总页数字段
        // },

        sort: true,
        form: true,
        ajax: {
          query: async ({ page, sorts, form }) => {
            console.log(page, sorts, form, "----");

            // 默认接收 Promise<{ result: [], page: { total: 100 } }>
            let result = await getProceduresTeamByPage({
              ...page,
              proceduresId: this.processRowData.id,
              // wo: this.woRawSub.wo ? this.woRawSub.wo : this.formData.workNo,
              // subId: this.woRawSub.id ? this.woRawSub.id : null,
            });
            this.woRawSub = { id: null, wo: null };
            return {
              result: result.data.records,
              page: {
                total: result.data.total,
              },
            };
          },
        },
      },
    };
    const sexListItemRender = {
      name: "VxeSelect",
      options: [
        // { label: "女", value: "Women" },
        // { label: "男", value: "Man" },
      ],
      props: {
        clearable: true,
        filterable: true,

        remote: true,
        remoteConfig: {
          queryMethod: async ({ searchValue }) => {
            console.log(searchValue, "====>searchValue测试===>");
            let result = await getTeamByPage({
              currentPage: 1,
              pageSize: 10,
            });
            this.sexListItemRender.options = result.data.records.map((item) => {
              return {
                value: item.id,
                label: item.name,
              };
            });
            console.log(
              sexListItemRender.options,
              "==>sexListItemRender.options"
            );
          },
        },
      },
    };
    const showPopup = false;
    const showPopup2 = false;
    const showPopup3 = false;
    const modalOptions3 = {
      title: "添加班组",
      width: 800,

      escClosable: true,
      resize: true,
      showMaximize: true,
      //禁止拖动
      draggable: true,
    };
    const modalOptions = {
      title: "在弹窗中使用表单",
      width: 800,

      escClosable: true,
      resize: true,
      showMaximize: true,
      //禁止拖动
      draggable: true,
    };
    const modalOptions2 = {
      title: "添加设备",
      width: "80%",
      height: 600,

      escClosable: true,
      resize: true,
      showMaximize: true,
      //禁止拖动
      draggable: true,
    };
    const sexItemRender = {
      name: "VxeSelect",
      options: [
        { label: "女", value: "Women" },
        { label: "男", value: "Man" },
      ],
    };
    const formOptions = {
      data: {
        name: "",
        role: "",
        sex: "",
        age: "",
        address: "",
      },
      rules: {
        // name: [{ required: true, message: "名称必填" }],
        // role: [{ required: true, message: "角色必填" }],
        // sex: [{ required: true, message: "性别必选" }],
        // age: [
        //   { required: true, message: "年龄必填" },
        //   { type: "number", min: 18, max: 46, message: "年龄范围18~46" },
        // ],
      },
      items: [
        {
          field: "code",
          title: "工序编码",
          span: 24,
          itemRender: { name: "VxeInput" },
        },
        {
          field: "name",
          title: "工序名称",
          span: 24,
          itemRender: { name: "VxeInput" },
        },
        {
          field: "standTime",
          title: "标准工时",
          span: 24,
          itemRender: { name: "VxeNumberInput", props: { type: "integer" } },
        },
        {
          field: "prepareTime",
          title: "准备工时",
          span: 24,
          itemRender: { name: "VxeNumberInput", props: { type: "integer" } },
        },
        {
          field: "transferTime",
          title: "转移工时",
          span: 24,
          itemRender: { name: "VxeNumberInput", props: { type: "integer" } },
        },
        // {
        //   field: "role",
        //   title: "角色",
        //   span: 24,
        //   itemRender: { name: "VxeInput" },
        // },
        // { field: "sex", title: "性别", span: 12, itemRender: sexItemRender },
        // {
        //   field: "age",
        //   title: "年龄",
        //   span: 12,
        //   itemRender: { name: "VxeNumberInput", props: { type: "integer" } },
        // },
        // {
        //   field: "address",
        //   title: "地址",
        //   span: 24,
        //   itemRender: { name: "VxeTextarea" },
        // },
        {
          align: "center",
          span: 24,
          itemRender: {
            name: "VxeButtonGroup",
            options: [
              { type: "submit", content: "提交", status: "primary" },
              { type: "reset", content: "重置" },
            ],
          },
        },
      ],
    };
    const formOptions3 = {
      data: {
        name: "",
        role: "",
        sex: "",
        age: "",
        address: "",
      },
      rules: {
        // name: [{ required: true, message: "名称必填" }],
        // role: [{ required: true, message: "角色必填" }],
        // sex: [{ required: true, message: "性别必选" }],
        // age: [
        //   { required: true, message: "年龄必填" },
        //   { type: "number", min: 18, max: 46, message: "年龄范围18~46" },
        // ],
      },
      items: [
        {
          field: "teamId",
          title: "班组选择",
          span: 24,
          itemRender: sexListItemRender,
        },

        // {
        //   field: "role",
        //   title: "角色",
        //   span: 24,
        //   itemRender: { name: "VxeInput" },
        // },
        // { field: "sex", title: "性别", span: 12, itemRender: sexItemRender },
        // {
        //   field: "age",
        //   title: "年龄",
        //   span: 12,
        //   itemRender: { name: "VxeNumberInput", props: { type: "integer" } },
        // },
        // {
        //   field: "address",
        //   title: "地址",
        //   span: 24,
        //   itemRender: { name: "VxeTextarea" },
        // },
        {
          align: "center",
          span: 24,
          itemRender: {
            name: "VxeButtonGroup",
            options: [
              { type: "submit", content: "提交", status: "primary" },
              { type: "reset", content: "重置" },
            ],
          },
        },
      ],
    };
    const rowData = {
      id: 0,
    };
    return {
      activeTab: "1",
      gridOptions,
      gridOptions2,
      gridOptions3,
      gridOptions4,
      showPopup,
      showPopup2,
      showPopup3,
      modalOptions,
      modalOptions2,
      modalOptions3,
      sexListItemRender,
      formOptions3,
      sexItemRender,
      formOptions,
      loading: false,
    };
  },
  methods: {
    toolbarButtonClickEvent(params) {
      if (params.code == "myAdd") {
        this.showPopup = true;
      }
      console.log(params.code);
    },
    formSubmitEvent() {
      console.log("form submit");
    },
    formResetEvent() {
      console.log("form reset");
    },
    //表单的提交
    async submitEvent() {
      this.loading = true;
      await addProcedures(this.formOptions.data);
      console.log("保存成功", JSON.stringify(this.formOptions.data));
      const $grid = this.$refs.gridRef.commitProxy("reload");
      VxeUI.modal.message({ content: "保存成功", status: "success" });
      this.loading = false;
      this.showPopup = false;
    },

    async submitEvent3() {
      this.loading = true;
      // await addProcedures(this.formOptions.data);
      console.log("保存成功", JSON.stringify(this.formOptions3.data));
      await addProceduresTeam({
        ...this.formOptions3.data,
        proceduresId: this.rowData.id,
      });

      // const $grid = this.$refs.gridRef.commitProxy("reload");
      // VxeUI.modal.message({ content: "保存成功", status: "success" });
      this.loading = false;
      this.showPopup3 = false;
      const $grid = this.$refs.gridRef4.commitProxy("reload");
    },
    //表单的重置
    resetEvent() {
      console.log("重置事件");
    },
    updateRow(row) {
      this.formOptions.data = row;
      this.showPopup = true;
      console.log(row.id, "---row---");
    },
    async deploy(row) {
      this.formOptions.data = row;
      console.log(row.id, "---row---");
      await camundaModelDeploymentById(row);
    },
    async deleteData(row) {
      await delProcedures({ id: row.id });
      const $grid = this.$refs.gridRef.commitProxy("reload");
      VxeUI.modal.message({ content: "删除成功", status: "success" });
    },
    bindEquipment(row) {
      this.showPopup2 = true;
      this.rowData = row;
    },
    currentRowChangeEvent({ row }) {
      // this.processRowData = row;
      this.processRowData = row;
      console.log(row);
      if (this.activeTab == "1") {
        const $grid = this.$refs.gridRef3.commitProxy("reload");
      } else {
        const $grid2 = this.$refs.gridRef4.commitProxy("reload");
      }
    },
    designRow(row) {
      this.$router.push({
        path: "/flowable/bpmtest",
        query: {
          id: row.id,
        },
      });

      console.log(row.id, "---row---");
    },
    bindTeam(row) {
      this.showPopup3 = true;
      this.rowData = row;
    },
    async confirmEvent() {
      const selectKeys = this.$refs.gridRef2.getCheckboxRecords();
      const equipmentPars = selectKeys.map((item) => {
        return {
          proceduresId: this.rowData.id,
          equipmentConfigId: item.id,
        };
      });

      await addProceduresEquipmentConfigs(equipmentPars);
      const $grid = this.$refs.gridRef3.commitProxy("reload");
      console.log(selectKeys, "---selectKeys---");
      console.log("===>config===");
    },
  },
};
</script>
<style lang="scss" scoped>
.content {
  height: calc(100vh - 130px);
}
</style>
